#include "animal.h"

Dog::Dog() : Animal{Species::DOG} {}

Dog::Dog(const std::string &name, int age) : Animal{Species::DOG, name, age} {}

std::string Dog::say() { return "bark bark..."; }

Cat::Cat() : Animal{Species::CAT} {}

Cat::Cat(const std::string &name, int age) : Animal{Species::CAT, name, age} {}

std::string Cat::say() { return "miao miao..."; }

Animal::Animal(Species species) : age{}, name{}, species(species) {}
Animal::Animal(Species species, const std::string &name, int age)
	: species(species), age{age}, name{name} {}

std::string Animal::toString() const {
	int i = static_cast<int>(species);
	return std::string("[") + g_SpeciesName[i] + "] " + "Name:" + name + ", " +
		   "Age:" + std::to_string(age);
}

void Animal::setSpecies(Species species) { this->species = species; }
std::string Animal::getSpeciesName() {
	int i = static_cast<int>(species);
	return g_SpeciesName[i];
}
Species Animal::getSpeciesId() const { return species; }
void Animal::setAge(int age) { this->age = age; }
int Animal::getAge() const { return age; }
void Animal::setName(const std::string &name) { this->name = name; }
std::string Animal::getName() const { return name; }